<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>




<head>
    <title>Title</title>
    <script src="/js/jquery-1.12.4.js" type="text/javascript"></script>
    <script type="text/javascript">
        function ll(){

var stuJson={
    "name":$("#name").val(),"pwd":$("#pwd").val()
};
alert(JSON.stringify(stuJson)),
            $.ajax({
                url:"P3",
                type:"Post",

                data: JSON.stringify(stuJson),
                contentType: "application/json",
                dataType:"json",
                success(data){
                    alert(JSON.stringify(data));
                },
                error(data){
                    alert("sai")
                }
            })
        }
    </script>

</head>
<body>

<form id="appl" action="p2"  method="post">
    <input type="text" name="name" id="name" placeholder="请输入水狗名"><br>
    <input type="text" name="pwd" id="pwd"><br>
<%--    <input type="text" name="dao[x].daoname" placeholder="请输入水狗名">--%>
<%--    <input type="text" name="dao[x].daonum" placeholder="请输入水狗h">--%>
<%--    <input type="text" name="dao[y].daoname" placeholder="请输入水狗名2">--%>
<%--    <input type="text" name="dao[y].daonum" placeholder="请输入水狗h2">--%>
    <input type="date" name="date"><br>


</form>
<form action="p4" >
    <input type="text" name="name" >
    <input type="text" name="pwd" >
    <input type="submit"><br>
</form>
<input type="button" name="tijiao" onclick="ll()">

</body>

</html>